from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options,service
driver=webdriver.Chrome(options=options,service=service)
driver.get(url=r'https://www.baidu.com/')
# name
# driver.find_element(By.NAME,'wd').send_keys('hello')
# sleep(3)
#tag
# driver.find_elements(By.TAG_NAME,'input')[7].send_keys('tag')
# sleep(3)
#class
# driver.find_elements(By.CLASS_NAME, 'bg')[2].click()
# sleep(3)
# # css定位 之 id选择器
# driver.find_element(By.CSS_SELECTOR,'#kw').send_keys('hello')
# sleep(3)
# css定位 之 class选择器
# driver.find_element(By.CSS_SELECTOR,'.s_ipt').send_keys('hello')
# driver.find_elements(By.CSS_SELECTOR, '.bg')[2].click()
# sleep(3)
# css定位 之 使用其他属性
driver.find_element(By.CSS_SELECTOR,'[name="wd"]').send_keys('hello')
sleep(3)




